package Entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

@Entity
@Table (name = "Carta")
public class CartaEntity implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column (name = "IdCarta")
	private int id;
	
	@Column (name = "FechaDesde")
	private Date fechaDesde;
	
	@Column (name = "FechaHasta")
	private Date fechaHasta;
	
	@ManyToOne
	@JoinColumn  (name = "idSucursal")
	//private int idSucursal;
	private SucursalEntity sucursal;
	
	@ManyToMany
	@JoinTable (name = "CartaProducto", joinColumns = {@JoinColumn (name = "idCarta")}, inverseJoinColumns = { @JoinColumn(name = "idProducto") })
	private List<ProductoEntity> areas = new ArrayList<ProductoEntity>();
}
